import {defineStore} from "pinia";

//定义存储
const useUserStore=defineStore('user',{
  state:()=>({
      user:{},
      login:false
  }),
  getters:{
      getUser(state){
        return state.user;
      },
      isLogin(state){
          return state.login;
      }
  },
    actions:{
        setUser(val){
          this.user=val
            this.login=true
        }
    },
persist:true
})
//导出存储
export {useUserStore};